import { Asepect, Pointcut } from "../src/decorator";


@Asepect()
class test {
    @Pointcut(["test.*"], [
        () => {
            console.log("This is before advice");
        },
        () => {
            console.log("this is after advice");
        },
        () => {
            console.log("this is after-return advice");
        },
        () => {
            console.log("this is after-throw advice");
        },
        () => {
            console.log("this is around advice");
        }
        //... 默认顺序为before after after-return after-throw around
        //不写则没有
    ])  //传入一个类名，通过类名的函数进行拦截，再传入一个函数数组，作为advices
    testPointcut: any;

    public testPointCut(arg: string) {
        console.log("hello " + arg);
    }
}


let testObj = new test

testObj.testPointCut("world");
